<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>商品管理</title>
</head>
<body class="hold-transition skin-black sidebar-mini">
<div th:replace="common/fragment :: link"></div>
<div class="wrapper">
    <div th:replace="common/fragment :: navbar"></div>
    <div th:replace="common/fragment :: menu"></div>
    <div class="content-wrapper">
        <section class="content-header">
            <h1>商品管理</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <!--高级查询--->
                    <form class="form-inline" id="searchForm" action="/goods/list" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">关键字:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword"   placeholder="请输入商品名称或者店铺名称">
                        </div>
                        <div class="form-group">
                            <label for="minSaleNum">最低销量:</label>
                            <input size="4" type="number" class="form-control" id="minSaleNum" name="minSaleNum" placeholder="请输入最低销量">
                        </div>
                        <div class="form-group">
                            <label for="maxSaleNum">最高销量:</label>
                            <input  size="4" type="number" class="form-control" id="maxSaleNum" name="maxSaleNum"  placeholder="请输入最高销量">
                        </div>
                        <div class="form-group">
                            <label for="status"> 商品状态:</label>
                            <select class="form-control" id="status" name="status">
                                <option value="-1">全部</option>
                                <option value="1">上线</option>
                                <option value="2">下线</option>
                            </select>
                            <script>
                                // $("#status").val(${qo.status})
                            </script>
                        </div>

                        <div class="form-group">
                            <label for="shop.id"> 店铺名称:</label>
                            <select class="form-control" name="shop.id" id="shop.id" >
                                <option value="-1">全部</option>
								<option th:each="shop,stat:${shops}"
                                        th:text="${shop?.name}" th:value="${shop?.id}">店铺1</option>
                            </select>
                        </div>

                        <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> 查询</button>
                        <a href="/goods/input" class="btn btn-success btn_redirect">
                            <span class="glyphicon glyphicon-plus"></span> 添加
                        </a>
                    </form>
                </div>
                <div class="box-body table-responsive ">
                    <table class="table table-hover table-bordered table-striped">
                        <thead>
						<tr>
                            <th>编号</th>
                            <th>商品名称</th>
                            <th>商品编号</th>
                            <th>商品销量</th>
                            <th>所属店铺</th>
                            <th>商品状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="goods,stat:${pageInfo.list}">
               
							<td  th:text="${stat.count}">1</td> 
                            <td th:text="${goods.name}">1</td>
                            <td th:text="${goods.sn}" >zs</td>
                            <td th:text="${goods.num}">11</td>
                            <td th:text="${goods?.shop?.name}">name</td>
						
                            <td>
                                  <span th:if="${goods.status}">
                                       上线
								  </span>
                                    <span th:unless="${goods.status}">
                                       下线
									</span>
                            </td>
							   
                            <td>
                                <a class="btn btn-info btn-xs btn_redirect" th:href="|/goods/input?id=${goods.id}|">
                                    <span class="glyphicon glyphicon-pencil"></span> 编辑
                                </a>
                                <a class="btn btn-danger btn-xs btn-delete" th:data-url="'/goods/delete?id='+${goods.id}">
                                    <span class="glyphicon glyphicon-trash"></span> 删除
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div th:replace="common/fragment :: page"></div>
                </div>
            </div>
        </section>
    </div>
    <div th:replace="common/fragment :: footer"></div>
</div>
</body>
</html>